package com.ruoyi.docs.service.impl;

import java.util.List;

import com.ruoyi.common.annotation.CommunityScope;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.docs.mapper.BizPeopleActivityMapper;
import com.ruoyi.docs.domain.BizPeopleActivity;
import com.ruoyi.docs.service.IBizPeopleActivityService;

/**
 * 活动参与Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-18
 */
@Service
public class BizPeopleActivityServiceImpl implements IBizPeopleActivityService 
{
    @Autowired
    private BizPeopleActivityMapper bizPeopleActivityMapper;

    /**
     * 查询活动参与
     * 
     * @param peopleActivityId 活动参与主键
     * @return 活动参与
     */
    @Override
    public BizPeopleActivity selectBizPeopleActivityByPeopleActivityId(Long peopleActivityId)
    {
        return bizPeopleActivityMapper.selectBizPeopleActivityByPeopleActivityId(peopleActivityId);
    }

    /**
     * 查询活动参与列表
     * 
     * @param bizPeopleActivity 活动参与
     * @return 活动参与
     */
    @Override
    @CommunityScope
    public List<BizPeopleActivity> selectBizPeopleActivityList(BizPeopleActivity bizPeopleActivity)
    {
        return bizPeopleActivityMapper.selectBizPeopleActivityList(bizPeopleActivity);
    }

    /**
     * 新增活动参与
     * 
     * @param bizPeopleActivity 活动参与
     * @return 结果
     */
    @Override
    public int insertBizPeopleActivity(BizPeopleActivity bizPeopleActivity)
    {
        bizPeopleActivity.setCreateTime(DateUtils.getNowDate());
        return bizPeopleActivityMapper.insertBizPeopleActivity(bizPeopleActivity);
    }

    /**
     * 修改活动参与
     * 
     * @param bizPeopleActivity 活动参与
     * @return 结果
     */
    @Override
    public int updateBizPeopleActivity(BizPeopleActivity bizPeopleActivity)
    {
        bizPeopleActivity.setUpdateTime(DateUtils.getNowDate());
        return bizPeopleActivityMapper.updateBizPeopleActivity(bizPeopleActivity);
    }

    /**
     * 批量删除活动参与
     * 
     * @param peopleActivityIds 需要删除的活动参与主键
     * @return 结果
     */
    @Override
    public int deleteBizPeopleActivityByPeopleActivityIds(Long[] peopleActivityIds)
    {
        return bizPeopleActivityMapper.deleteBizPeopleActivityByPeopleActivityIds(peopleActivityIds);
    }

    /**
     * 删除活动参与信息
     * 
     * @param peopleActivityId 活动参与主键
     * @return 结果
     */
    @Override
    public int deleteBizPeopleActivityByPeopleActivityId(Long peopleActivityId)
    {
        return bizPeopleActivityMapper.deleteBizPeopleActivityByPeopleActivityId(peopleActivityId);
    }

    /**
     * 关联更新
     *
     * @param bizPeopleActivity
     */
    @Override
    public int updateRelationBizPeopleActivity(BizPeopleActivity bizPeopleActivity) {
        return bizPeopleActivityMapper.updateRelationBizPeopleActivity(bizPeopleActivity);

    }
}
